package p270jp.pxv.android.fragment;

import android.content.ComponentCallbacks;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelStore;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.billingclient.api.Purchase;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Objects;
import p005a5.C0022b;
import p013ad.Action;
import p013ad.Consumer;
import p014ae.C0123m7;
import p014ae.C0126n7;
import p014ae.View$OnClickListenerC0054c;
import p045be.PpointPriceListAdapter;
import p047bg.C1124a;
import p060c2.Chain;
import p064c6.Preconditions;
import p071cd.Functions;
import p134ei.AnalyticsAction;
import p134ei.PixivAnalytics;
import p162fl.BillingItemRepository;
import p165fo.C3114c;
import p165fo.Subscribe;
import p189gn.AbstractC3435a;
import p216hn.Lambda;
import p216hn.Reflection;
import p232id.ObservableHide;
import p270jp.pxv.android.R;
import p270jp.pxv.android.event.EventNone;
import p270jp.pxv.android.event.RetryConsume;
import p270jp.pxv.android.event.RetryPointPurchase;
import p270jp.pxv.android.event.ShowRetryConsumeDescription;
import p270jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment;
import p270jp.pxv.android.model.PurchasedStatus;
import p294ko.ViewModelOwner;
import p314lg.FragmentPixivPointPurchaseBottomSheetBinding;
import p325m0.MutabilityOwnership;
import p370ni.InfoType;
import p446qh.PpointPurchaseDomainService;
import p447qi.EventPublishDialogFragment;
import p467rd.subscribers;
import p491sd.C6034a;
import p517td.PublishSubject;
import p545uf.NotEmptyList;
import p547uh.C6414c7;
import p547uh.C6429d7;
import p547uh.C6608x6;
import p547uh.C6611y6;
import p547uh.Hilt_PixivPointPurchaseBottomSheetFragment;
import p554uo.DefinitionParameters;
import p569vd.C6831c;
import p579vo.Qualifier;
import p603wm.AbstractC6949c;
import p603wm.Unit;
import p611x4.C7075g;
import p645yc.AndroidSchedulers;
import p653yk.C7375g;
import p653yk.C7376h;
import p653yk.C7377i;
import p653yk.C7378j;
import p653yk.C7379k;
import p653yk.PixivPointActionCreator;
import p653yk.PpointPurchaseAction;
import p653yk.PpointPurchaseActionCreator;
import p653yk.PpointPurchaseStore;
import p671zc.CompositeDisposable;
import p671zc.Disposable;

/* compiled from: PixivPointPurchaseBottomSheetFragment.kt */
/* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment */
/* loaded from: classes2.dex */
public final class PixivPointPurchaseBottomSheetFragment extends Hilt_PixivPointPurchaseBottomSheetFragment {

    /* renamed from: l */
    public static final /* synthetic */ int f19023l;

    /* renamed from: f */
    public final AbstractC6949c f19024f = Preconditions.m9802P(3, new C4237f(this, null, null, new C4236e(this), new C4232a()));

    /* renamed from: g */
    public final AbstractC6949c f19025g = Preconditions.m9802P(3, new C4239h(this, null, null, new C4238g(this), null));

    /* renamed from: h */
    public final AbstractC6949c f19026h = Preconditions.m9802P(3, new C4235d(this, null, null, new C4234c(this), null));

    /* renamed from: i */
    public final AbstractC6949c f19027i = Preconditions.m9802P(1, new C4233b(this, null, null));

    /* renamed from: j */
    public FragmentPixivPointPurchaseBottomSheetBinding f19028j;

    /* renamed from: k */
    public PpointPriceListAdapter f19029k;

    /* compiled from: PixivPointPurchaseBottomSheetFragment.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$a */
    /* loaded from: classes2.dex */
    public static final class C4232a extends Lambda implements AbstractC3435a<DefinitionParameters> {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4232a() {
            super(0);
            PixivPointPurchaseBottomSheetFragment.this = r1;
        }

        @Override // p189gn.AbstractC3435a
        public DefinitionParameters invoke() {
            return C0022b.m12183x(PixivPointPurchaseBottomSheetFragment.this.requireActivity());
        }
    }

    /* compiled from: ComponentCallbackExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$b */
    /* loaded from: classes2.dex */
    public static final class C4233b extends Lambda implements AbstractC3435a<PixivAnalytics> {

        /* renamed from: a */
        public final /* synthetic */ ComponentCallbacks f19031a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4233b(ComponentCallbacks componentCallbacks, Qualifier aVar, AbstractC3435a aVar2) {
            super(0);
            this.f19031a = componentCallbacks;
        }

        /* JADX WARN: Type inference failed for: r0v4, types: [ei.e, java.lang.Object] */
        @Override // p189gn.AbstractC3435a
        public final PixivAnalytics invoke() {
            return C1124a.m10173s(this.f19031a).f24118a.m920a().m621a(Reflection.m5499a(PixivAnalytics.class), null, null);
        }
    }

    /* compiled from: SharedViewModelExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$c */
    /* loaded from: classes2.dex */
    public static final class C4234c extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ Fragment f19032a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4234c(Fragment fragment) {
            super(0);
            this.f19032a = fragment;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            FragmentActivity requireActivity = this.f19032a.requireActivity();
            MutabilityOwnership.m3746l(requireActivity, "requireActivity()");
            FragmentActivity requireActivity2 = this.f19032a.requireActivity();
            ViewModelStore viewModelStore = requireActivity.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, requireActivity2);
        }
    }

    /* compiled from: SharedViewModelExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$d */
    /* loaded from: classes2.dex */
    public static final class C4235d extends Lambda implements AbstractC3435a<PixivPointActionCreator> {

        /* renamed from: a */
        public final /* synthetic */ Fragment f19033a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19034b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4235d(Fragment fragment, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19033a = fragment;
            this.f19034b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, yk.b] */
        @Override // p189gn.AbstractC3435a
        public PixivPointActionCreator invoke() {
            return C1124a.m10172t(this.f19033a, null, null, this.f19034b, Reflection.m5499a(PixivPointActionCreator.class), null);
        }
    }

    /* compiled from: FragmentExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$e */
    /* loaded from: classes2.dex */
    public static final class C4236e extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ Fragment f19035a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4236e(Fragment fragment) {
            super(0);
            this.f19035a = fragment;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            Fragment fragment = this.f19035a;
            MutabilityOwnership.m3745m(fragment, "storeOwner");
            ViewModelStore viewModelStore = fragment.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, fragment);
        }
    }

    /* compiled from: FragmentExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$f */
    /* loaded from: classes2.dex */
    public static final class C4237f extends Lambda implements AbstractC3435a<PpointPurchaseActionCreator> {

        /* renamed from: a */
        public final /* synthetic */ Fragment f19036a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19037b;

        /* renamed from: c */
        public final /* synthetic */ AbstractC3435a f19038c;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4237f(Fragment fragment, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19036a = fragment;
            this.f19037b = aVar3;
            this.f19038c = aVar4;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, yk.f] */
        @Override // p189gn.AbstractC3435a
        public PpointPurchaseActionCreator invoke() {
            return C1124a.m10172t(this.f19036a, null, null, this.f19037b, Reflection.m5499a(PpointPurchaseActionCreator.class), this.f19038c);
        }
    }

    /* compiled from: FragmentExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$g */
    /* loaded from: classes2.dex */
    public static final class C4238g extends Lambda implements AbstractC3435a<ViewModelOwner> {

        /* renamed from: a */
        public final /* synthetic */ Fragment f19039a;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4238g(Fragment fragment) {
            super(0);
            this.f19039a = fragment;
        }

        @Override // p189gn.AbstractC3435a
        public ViewModelOwner invoke() {
            Fragment fragment = this.f19039a;
            MutabilityOwnership.m3745m(fragment, "storeOwner");
            ViewModelStore viewModelStore = fragment.getViewModelStore();
            MutabilityOwnership.m3746l(viewModelStore, "storeOwner.viewModelStore");
            return new ViewModelOwner(viewModelStore, fragment);
        }
    }

    /* compiled from: FragmentExt.kt */
    /* renamed from: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$h */
    /* loaded from: classes2.dex */
    public static final class C4239h extends Lambda implements AbstractC3435a<PpointPurchaseStore> {

        /* renamed from: a */
        public final /* synthetic */ Fragment f19040a;

        /* renamed from: b */
        public final /* synthetic */ AbstractC3435a f19041b;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public C4239h(Fragment fragment, Qualifier aVar, AbstractC3435a aVar2, AbstractC3435a aVar3, AbstractC3435a aVar4) {
            super(0);
            this.f19040a = fragment;
            this.f19041b = aVar3;
        }

        /* JADX WARN: Type inference failed for: r0v1, types: [androidx.lifecycle.j0, yk.l] */
        @Override // p189gn.AbstractC3435a
        public PpointPurchaseStore invoke() {
            return C1124a.m10172t(this.f19040a, null, null, this.f19041b, Reflection.m5499a(PpointPurchaseStore.class), null);
        }
    }

    /* renamed from: g */
    public static final PixivPointPurchaseBottomSheetFragment m4616g(long j) {
        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment = new PixivPointPurchaseBottomSheetFragment();
        Bundle bundle = new Bundle();
        bundle.putLong("args_point", j);
        pixivPointPurchaseBottomSheetFragment.setArguments(bundle);
        return pixivPointPurchaseBottomSheetFragment;
    }

    /* renamed from: h */
    public final PpointPurchaseActionCreator m4615h() {
        return (PpointPurchaseActionCreator) this.f19024f.getValue();
    }

    /* renamed from: i */
    public final PpointPurchaseStore m4614i() {
        return (PpointPurchaseStore) this.f19025g.getValue();
    }

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        MutabilityOwnership.m3745m(layoutInflater, "inflater");
        Preconditions.m9798T(m4614i().f30970r, this, new p547uh.PixivPointPurchaseBottomSheetFragment(this));
        m4614i().f30971s.mo2789b(this, new Observer(this, 0) { // from class: uh.z6

            /* renamed from: a */
            public final /* synthetic */ int f28235a;

            /* renamed from: b */
            public final /* synthetic */ PixivPointPurchaseBottomSheetFragment f28236b;

            {
                this.f28235a = r2;
                this.f28236b = r1;
            }

            @Override // androidx.lifecycle.Observer
            /* renamed from: a */
            public final void mo1404a(Object obj) {
                switch (this.f28235a) {
                    case 0:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment = this.f28236b;
                        Unit jVar = (Unit) obj;
                        int i = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment, "this$0");
                        FragmentPixivPointPurchaseBottomSheetBinding d4Var = pixivPointPurchaseBottomSheetFragment.f19028j;
                        if (d4Var != null) {
                            d4Var.f21432q.m4595d(InfoType.SMART_ERROR, new View$OnClickListenerC0054c(pixivPointPurchaseBottomSheetFragment, 18));
                            return;
                        } else {
                            MutabilityOwnership.m3737u("binding");
                            throw null;
                        }
                    default:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment2 = this.f28236b;
                        String str = (String) obj;
                        int i2 = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment2, "this$0");
                        MutabilityOwnership.m3747j(str);
                        PpointPurchaseActionCreator h = pixivPointPurchaseBottomSheetFragment2.m4615h();
                        Objects.requireNonNull(h);
                        PpointPurchaseDomainService aVar = h.f30935d;
                        Objects.requireNonNull(aVar);
                        BillingItemRepository bVar = aVar.f25419a;
                        Objects.requireNonNull(bVar);
                        ArrayList arrayList = new ArrayList(Chain.m9926x(str));
                        C7075g gVar = new C7075g();
                        gVar.f29829a = "inapp";
                        gVar.f29830b = arrayList;
                        Disposable d = subscribers.m2592d(bVar.f14650a.m70b(gVar), C7375g.f30947a, C7376h.f30948a);
                        CompositeDisposable aVar2 = h.f30936e;
                        MutabilityOwnership.m3744n(aVar2, "compositeDisposable");
                        aVar2.mo82c(d);
                        return;
                }
            }
        });
        m4614i().f30973u.mo2789b(this, new Observer(this, 0) { // from class: uh.a7

            /* renamed from: a */
            public final /* synthetic */ int f27321a;

            /* renamed from: b */
            public final /* synthetic */ PixivPointPurchaseBottomSheetFragment f27322b;

            {
                this.f27321a = r2;
                this.f27322b = r1;
            }

            @Override // androidx.lifecycle.Observer
            /* renamed from: a */
            public final void mo1404a(Object obj) {
                switch (this.f27321a) {
                    case 0:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment = this.f27322b;
                        PurchasedStatus purchasedStatus = (PurchasedStatus) obj;
                        int i = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment, "this$0");
                        if (purchasedStatus instanceof PurchasedStatus.Success) {
                            PurchasedStatus.Success success = (PurchasedStatus.Success) purchasedStatus;
                            Iterator<Purchase> it = success.getPurchases().iterator();
                            while (it.hasNext()) {
                                ((PixivAnalytics) pixivPointPurchaseBottomSheetFragment.f19027i.getValue()).m6527c(20, AnalyticsAction.POINT_PURCHASE, it.next().m9640c());
                            }
                            PpointPurchaseActionCreator h = pixivPointPurchaseBottomSheetFragment.m4615h();
                            NotEmptyList<Purchase> purchases = success.getPurchases();
                            String string = pixivPointPurchaseBottomSheetFragment.getString(R.string.point_apply);
                            MutabilityOwnership.m3746l(string, "getString(jp.pxv.android…acy.R.string.point_apply)");
                            h.m320d(purchases, string);
                            return;
                        } else if ((purchasedStatus instanceof PurchasedStatus.EmptyStatusSuccess) || (purchasedStatus instanceof PurchasedStatus.UserCancel)) {
                            return;
                        } else {
                            if (purchasedStatus instanceof PurchasedStatus.ItemAlreadyOwned) {
                                Context context = pixivPointPurchaseBottomSheetFragment.getContext();
                                if (context != null) {
                                    Toast.makeText(context, (int) R.string.point_purchase_error, 1).show();
                                }
                                pixivPointPurchaseBottomSheetFragment.m4615h().m318f();
                                return;
                            }
                            Context context2 = pixivPointPurchaseBottomSheetFragment.getContext();
                            if (context2 != null) {
                                Toast.makeText(context2, (int) R.string.point_purchase_error, 1).show();
                                return;
                            }
                            return;
                        }
                    default:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment2 = this.f27322b;
                        Unit jVar = (Unit) obj;
                        int i2 = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment2, "this$0");
                        EventPublishDialogFragment.C5840a aVar = EventPublishDialogFragment.f25435a;
                        String string2 = pixivPointPurchaseBottomSheetFragment2.getString(R.string.point_consume_retry_description);
                        String string3 = pixivPointPurchaseBottomSheetFragment2.getString(R.string.common_ok);
                        MutabilityOwnership.m3746l(string3, "getString(jp.pxv.android…egacy.R.string.common_ok)");
                        EventPublishDialogFragment.C5840a.m2776c(aVar, string2, string3, null, new EventNone(), null, null, false, 116).show(pixivPointPurchaseBottomSheetFragment2.getChildFragmentManager(), "consume_error_description_dialog");
                        return;
                }
            }
        });
        m4614i().f30969q.mo2790a(this, new C6414c7(this));
        m4614i().f30972t.mo2790a(this, new C6429d7(this));
        m4614i().f30974v.mo2789b(this, new C6611y6(this, 0));
        m4614i().f30976x.mo2789b(this, new C6608x6(this, 0));
        m4614i().f30975w.mo2789b(this, new C0126n7(this, 1));
        m4614i().f30977y.mo2789b(this, new C0123m7(this, 1));
        m4614i().f30952A.mo2789b(this, new Observer(this, 1) { // from class: uh.z6

            /* renamed from: a */
            public final /* synthetic */ int f28235a;

            /* renamed from: b */
            public final /* synthetic */ PixivPointPurchaseBottomSheetFragment f28236b;

            {
                this.f28235a = r2;
                this.f28236b = r1;
            }

            @Override // androidx.lifecycle.Observer
            /* renamed from: a */
            public final void mo1404a(Object obj) {
                switch (this.f28235a) {
                    case 0:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment = this.f28236b;
                        Unit jVar = (Unit) obj;
                        int i = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment, "this$0");
                        FragmentPixivPointPurchaseBottomSheetBinding d4Var = pixivPointPurchaseBottomSheetFragment.f19028j;
                        if (d4Var != null) {
                            d4Var.f21432q.m4595d(InfoType.SMART_ERROR, new View$OnClickListenerC0054c(pixivPointPurchaseBottomSheetFragment, 18));
                            return;
                        } else {
                            MutabilityOwnership.m3737u("binding");
                            throw null;
                        }
                    default:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment2 = this.f28236b;
                        String str = (String) obj;
                        int i2 = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment2, "this$0");
                        MutabilityOwnership.m3747j(str);
                        PpointPurchaseActionCreator h = pixivPointPurchaseBottomSheetFragment2.m4615h();
                        Objects.requireNonNull(h);
                        PpointPurchaseDomainService aVar = h.f30935d;
                        Objects.requireNonNull(aVar);
                        BillingItemRepository bVar = aVar.f25419a;
                        Objects.requireNonNull(bVar);
                        ArrayList arrayList = new ArrayList(Chain.m9926x(str));
                        C7075g gVar = new C7075g();
                        gVar.f29829a = "inapp";
                        gVar.f29830b = arrayList;
                        Disposable d = subscribers.m2592d(bVar.f14650a.m70b(gVar), C7375g.f30947a, C7376h.f30948a);
                        CompositeDisposable aVar2 = h.f30936e;
                        MutabilityOwnership.m3744n(aVar2, "compositeDisposable");
                        aVar2.mo82c(d);
                        return;
                }
            }
        });
        m4614i().f30978z.mo2789b(this, new Observer(this, 1) { // from class: uh.a7

            /* renamed from: a */
            public final /* synthetic */ int f27321a;

            /* renamed from: b */
            public final /* synthetic */ PixivPointPurchaseBottomSheetFragment f27322b;

            {
                this.f27321a = r2;
                this.f27322b = r1;
            }

            @Override // androidx.lifecycle.Observer
            /* renamed from: a */
            public final void mo1404a(Object obj) {
                switch (this.f27321a) {
                    case 0:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment = this.f27322b;
                        PurchasedStatus purchasedStatus = (PurchasedStatus) obj;
                        int i = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment, "this$0");
                        if (purchasedStatus instanceof PurchasedStatus.Success) {
                            PurchasedStatus.Success success = (PurchasedStatus.Success) purchasedStatus;
                            Iterator<Purchase> it = success.getPurchases().iterator();
                            while (it.hasNext()) {
                                ((PixivAnalytics) pixivPointPurchaseBottomSheetFragment.f19027i.getValue()).m6527c(20, AnalyticsAction.POINT_PURCHASE, it.next().m9640c());
                            }
                            PpointPurchaseActionCreator h = pixivPointPurchaseBottomSheetFragment.m4615h();
                            NotEmptyList<Purchase> purchases = success.getPurchases();
                            String string = pixivPointPurchaseBottomSheetFragment.getString(R.string.point_apply);
                            MutabilityOwnership.m3746l(string, "getString(jp.pxv.android…acy.R.string.point_apply)");
                            h.m320d(purchases, string);
                            return;
                        } else if ((purchasedStatus instanceof PurchasedStatus.EmptyStatusSuccess) || (purchasedStatus instanceof PurchasedStatus.UserCancel)) {
                            return;
                        } else {
                            if (purchasedStatus instanceof PurchasedStatus.ItemAlreadyOwned) {
                                Context context = pixivPointPurchaseBottomSheetFragment.getContext();
                                if (context != null) {
                                    Toast.makeText(context, (int) R.string.point_purchase_error, 1).show();
                                }
                                pixivPointPurchaseBottomSheetFragment.m4615h().m318f();
                                return;
                            }
                            Context context2 = pixivPointPurchaseBottomSheetFragment.getContext();
                            if (context2 != null) {
                                Toast.makeText(context2, (int) R.string.point_purchase_error, 1).show();
                                return;
                            }
                            return;
                        }
                    default:
                        PixivPointPurchaseBottomSheetFragment pixivPointPurchaseBottomSheetFragment2 = this.f27322b;
                        Unit jVar = (Unit) obj;
                        int i2 = PixivPointPurchaseBottomSheetFragment.f19023l;
                        MutabilityOwnership.m3745m(pixivPointPurchaseBottomSheetFragment2, "this$0");
                        EventPublishDialogFragment.C5840a aVar = EventPublishDialogFragment.f25435a;
                        String string2 = pixivPointPurchaseBottomSheetFragment2.getString(R.string.point_consume_retry_description);
                        String string3 = pixivPointPurchaseBottomSheetFragment2.getString(R.string.common_ok);
                        MutabilityOwnership.m3746l(string3, "getString(jp.pxv.android…egacy.R.string.common_ok)");
                        EventPublishDialogFragment.C5840a.m2776c(aVar, string2, string3, null, new EventNone(), null, null, false, 116).show(pixivPointPurchaseBottomSheetFragment2.getChildFragmentManager(), "consume_error_description_dialog");
                        return;
                }
            }
        });
        m4614i().f30954C.mo2789b(this, new C6611y6(this, 1));
        m4614i().f30953B.mo2789b(this, new C6608x6(this, 1));
        ViewDataBinding c = DataBindingUtil.m11370c(layoutInflater, R.layout.fragment_pixiv_point_purchase_bottom_sheet, viewGroup, false);
        MutabilityOwnership.m3746l(c, "inflate(inflater, R.layo…_sheet, container, false)");
        this.f19028j = (FragmentPixivPointPurchaseBottomSheetBinding) c;
        this.f19029k = new PpointPriceListAdapter(m4615h());
        FragmentPixivPointPurchaseBottomSheetBinding d4Var = this.f19028j;
        if (d4Var != null) {
            RecyclerView recyclerView = d4Var.f21433r;
            recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()) { // from class: jp.pxv.android.fragment.PixivPointPurchaseBottomSheetFragment$onCreateView$1$1
                @Override // androidx.recyclerview.widget.LinearLayoutManager, androidx.recyclerview.widget.RecyclerView.LayoutManager
                /* renamed from: e0 */
                public boolean mo4613e0() {
                    return false;
                }
            });
            PpointPriceListAdapter u1Var = this.f19029k;
            if (u1Var != null) {
                recyclerView.setAdapter(u1Var);
                String string = getString(R.string.point_suffix, Preconditions.m9814D(requireArguments().getLong("args_point")));
                MutabilityOwnership.m3746l(string, "getString(jp.pxv.android…s.formatPointText(point))");
                FragmentPixivPointPurchaseBottomSheetBinding d4Var2 = this.f19028j;
                if (d4Var2 != null) {
                    d4Var2.f21434s.setText(getString(R.string.point_usage, string));
                    FragmentPixivPointPurchaseBottomSheetBinding d4Var3 = this.f19028j;
                    if (d4Var3 != null) {
                        d4Var3.f21432q.m4595d(InfoType.LOADING, null);
                        PpointPurchaseActionCreator h = m4615h();
                        Disposable d = subscribers.m2592d(h.f30935d.m2784c().m1008i(C6034a.f26178c).m1011f(AndroidSchedulers.m334a()), new C7377i(h), new C7378j(h));
                        CompositeDisposable aVar = h.f30936e;
                        MutabilityOwnership.m3744n(aVar, "compositeDisposable");
                        aVar.mo82c(d);
                        PpointPurchaseActionCreator h2 = m4615h();
                        PublishSubject<PurchasedStatus> bVar = h2.f30935d.f25419a.f14650a.f31453a.f31450c.f31445a;
                        Objects.requireNonNull(bVar);
                        ObservableHide oVar = new ObservableHide(bVar);
                        C6831c cVar = C6831c.f29057g;
                        Consumer<? super Throwable> eVar = Functions.f5387d;
                        Action aVar2 = Functions.f5386c;
                        Disposable g = subscribers.m2589g(oVar.m993h(cVar, eVar, aVar2, aVar2).m986o(AndroidSchedulers.m334a()), null, null, new C7379k(h2), 3);
                        CompositeDisposable aVar3 = h2.f30936e;
                        MutabilityOwnership.m3744n(aVar3, "compositeDisposable");
                        aVar3.mo82c(g);
                        FragmentPixivPointPurchaseBottomSheetBinding d4Var4 = this.f19028j;
                        if (d4Var4 != null) {
                            return d4Var4.f2666e;
                        }
                        MutabilityOwnership.m3737u("binding");
                        throw null;
                    }
                    MutabilityOwnership.m3737u("binding");
                    throw null;
                }
                MutabilityOwnership.m3737u("binding");
                throw null;
            }
            MutabilityOwnership.m3737u("adapter");
            throw null;
        }
        MutabilityOwnership.m3737u("binding");
        throw null;
    }

    @Subscribe
    public final void onEvent(RetryConsume retryConsume) {
        MutabilityOwnership.m3745m(retryConsume, "event");
        m4615h().m319e();
    }

    @Override // androidx.fragment.app.Fragment
    public void onPause() {
        C3114c.m6284b().m6274l(this);
        super.onPause();
    }

    @Override // androidx.fragment.app.Fragment
    public void onResume() {
        super.onResume();
        C3114c.m6284b().m6276j(this);
    }

    @Subscribe
    public final void onEvent(ShowRetryConsumeDescription showRetryConsumeDescription) {
        MutabilityOwnership.m3745m(showRetryConsumeDescription, "event");
        m4615h().f30934c.mo2437b(PpointPurchaseAction.C7364n.f30930a);
    }

    @Subscribe
    public final void onEvent(RetryPointPurchase retryPointPurchase) {
        MutabilityOwnership.m3745m(retryPointPurchase, "event");
        m4615h().m316h(retryPointPurchase.getProductId());
    }
}
